#pragma once

/*
 *	IS CURRENTLY NOT A POOL. IS A MANAGER. ...is kind of a pool though.
 */

#include "precompiled.h"

class Camera;
class Texture;

namespace ShaderPool
{
	typedef struct{
		GLhandleARB program;					// Shader objects.
		std::string key;						// Text desciption.
		std::string path_vs, path_gs, path_fs;	// Shader string paths.
		GLhandleARB  compVS, compGS, compFS;			// Compiled shaders.
	}shaderDesc;

	void Initialize();

	void PoolShaders();
	void SetShader( std::string key );

	void create_default_shaders();
	GLhandleARB createShader( shaderDesc* ptr_sd, std::string key, char const* vs_path, char const* fs_path );
	GLhandleARB createShader( shaderDesc* ptr_sd, std::string key, char const* vs_path, char const* gs_path, char const* fs_path );
	unsigned char* readShaderFile(const char *filename);
	void reload_shaders();

	// Update.
	void update_uniform_MVP_View(  );
	void update_uniform_MVP_View( glm::mat4 &modelViewProj );
	void update_uniform_VP( glm::mat4 &ViewProj );
	void update_uniform_CameraPosition( glm::vec3 const& CameraPos );
	void update_uniform_time( GLdouble t0 );
	void update_uniform_flash( GLfloat amount );

	// Get.
	GLhandleARB ProgramObject();

	// State.
	void SetForFSQ();
	void BindTextureToScreenBuffer( Texture* );


	namespace Shaders{
		extern const char* DEFAULT;
		extern const char* NORMALDIFFUSE;
		extern const char* BILLBOARD;
	}
};

